<?php

namespace App\Models;

use Laravel\Passport\HasApiTokens;
use Illuminate\Foundation\Auth\User as AuthUser;
use App\Observers\ApiiObserver;
use Illuminate\Database\Eloquent\SoftDeletes;
use App\Models\Traits\Btn;

class Apiiuser extends AuthUser
{
    // 调用定义好的trait 类 软删除  Btn
    use SoftDeletes, Btn, HasApiTokens;

    // 软删除表示字段
    protected $dates = ['deleted_at'];

    // 不添加的字段
    protected $guarded = [];

    // 事件监听 ApiiObserver
    protected static function boot()
    {
        parent::boot();
        self::observe(ApiiObserver::class);
    }
}
